package o;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.huawei.appgallery.foundation.application.pkgmanage.model.reserve.ReserveDbInfo;
import o.dsi.b;

public class dsj implements cdd {
    public void ˎ() {
        dsi.ˋ(b.InstallExecptionRecovery, null, false);
        ˊ();
    }

    private void ˊ() {
        Intent intent = new Intent();
        intent.setAction(dvq.ˊ());
        intent.setPackage(ContentManager.getInstant().getContext().getPackageName());
        ContentManager.getInstant().getContext().sendBroadcast(intent);
    }

    public void ˏ(@NonNull String str, int i) {
        if (i == 2) {
            dsi.ˏ(new eat(str));
        } else if (i == 5) {
            dsi.ˏ(new eat(str));
        }
    }

    public void ˏ(int i, @Nullable String str, int i2) {
        if (i == 1) {
            if (i2 == 2 && !TextUtils.isEmpty(str)) {
                dsz.ˊ(str);
            } else if (i2 == 1 && !TextUtils.isEmpty(str)) {
                ReserveDbInfo ॱ = efg.ˋ().ॱ(str);
                PackageInfo ᐝ = ((cdg) cdb.ॱ(cdg.class)).ᐝ(str);
                if (!(ॱ == null || ᐝ == null || TextUtils.isEmpty(ॱ.ͺ()))) {
                    try {
                        if (Integer.parseInt(ॱ.ᐝॱ()) <= ᐝ.versionCode) {
                            efb.ॱ().ˏ(str);
                        }
                    } catch (NumberFormatException e) {
                        Logger.ˎ("AppDataMoniorImpl", "ReserveDbInfo versionCode error:" + ॱ.ᐝॱ());
                    }
                }
            }
            ˊ();
        } else if (i == 2) {
            ˊ();
        }
    }
}
